package main

import (
	"encoding/json"
	"fmt"
	// "os"
)

type Response1 struct {
	Page   int
	Fruits []string
}

type Response2 struct {
	page   int      `json:"page"`
	Fruits []string `json:"fruits"`
}

func main() {
	bloB, _ := json.Marshal(true)
	fmt.Println(string(bloB))

	intB, _ := json.Marshal(1)
	fmt.Println(string(intB))

	slcD := []string{"apple", "peach", "pear"}
	slcB, _ := json.Marshal(slcD)
	fmt.Println(string(slcB))

	str := `{"page": 1, "fruits": ["apple", "peach"]}`
	res := &Response2{}
	json.Unmarshal([]byte(str), &res)
	fmt.Println(res)
	fmt.Println(res.Fruits[0])
}
